class ServiceException(BaseException):
    def __init__(self, msg):
        super().__init__(msg)


def verify(username: str, password: str):
    if username == 'username' and 'password == password':
        print("登录成功")
    else:
        raise ServiceException("密码错误")
try:
    verify(username="Jack", password="<PASSWORD>")
except ServiceException as se:
    print(se)
except BaseException as e:
    print(e)
finally:
    print("finally代码执行")

verify('username', 'password')